feat(automation): object-form screen-flow steps + CRM lead→customer/opportunity wizard#1977
Merged
Merged
Conversation
…pportunity wizard
Extend the screen-flow runtime so a `screen` node can render a target object's
FULL create/edit form — including inline master-detail child grids — instead of
a flat field list. A step that declares `config.objectName` emits an
`object-form` ScreenSpec; the client renders the real ObjectForm, persists the
record (and its children, atomically), and resumes the run with the new id
bound to `config.idVariable` so a later step can reference it.
CRM example: convert-lead.flow is now a two-step wizard — Step 1 a full Customer
(Account) form prefilled from the lead, Step 2 a full Opportunity form WITH an
editable product line-item grid (new crm_opportunity_line_item, master_detail +
inlineEdit:'grid'; Opportunity gains a line_total rollup). The flow then marks
the lead converted and links it to the new account + opportunity.
Also fixes get_lead: get_record reads `config.filter`, not a bare
`config.recordId`, so the node now filters by `{ id: '{recordId}' }` instead of
silently returning the first record.
- spec: ScreenSpec gains kind/objectName/mode/recordId/defaults/idVariable
- service-automation: screen node emits object-form specs + interpolates
title/description/field-defaults/object-form-defaults against flow vars
- app-crm: new line-item object, Opportunity line_total summary, rewritten
convert-lead wizard, smoke test updated for the 6th object
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 91 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the screen-flow runtime so a
screennode can render a target object's full create/edit form — including inline master-detail child grids — instead of a flat field list, and ships a CRM lead-conversion wizard that uses it.A step that declares
config.objectNameemits anobject-formScreenSpec. The client (objectuiFlowRunner, companion PR) renders the realObjectForm, persists the record (and its children, atomically), and resumes the run with the new record's id bound toconfig.idVariableso a later step can reference it. Model: the form persists itself, the flow orchestrates the sequence and threads the new ids.CRM example — Convert Lead → Customer + Opportunity
convert-lead.flowis now a two-step wizard:crm_opportunity_line_item,master_detail+inlineEdit: 'grid'; Opportunity gains aline_totalrollup). Account FK prefilled with Step 1's new id.The flow then marks the lead
convertedand links it to the new account + opportunity.Bug fix bundled here
get_leadusedconfig.recordId, but theget_recordnode only readsconfig.filter— so it silently returned the first lead regardless of the record acted on. Now filters by{ id: '{recordId}' }. (The old wizard never surfaced this because it never visibly used the loaded record.)Changes
ScreenSpecgainskind/objectName/mode/recordId/defaults/idVariable.screennode emits object-form specs and now interpolatestitle/description/ fielddefaultValue/ object-formdefaultsagainst live flow variables (the engine does not pre-interpolate node config).crm_opportunity_line_itemobject,Opportunity.line_totalsummary, rewrittenconvert-leadwizard; smoke test updated for the 6th object.Verification
End-to-end in the browser (objectui console against
app-crm): Convert Lead → full Customer form (prefilled) saves → full Opportunity form + product grid (prefilled, live amount calc) saves → leadconverted, linked to account + opportunity,line_totalrolled up.app-crmsmoke test (29 cases) passes;service-automationbuilds clean.🤖 Generated with Claude Code